package com.jt.provider.controller;


import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class DefaultErquestOriginParser implements RequestOriginParser {

    @Override
    public String parseOrigin(HttpServletRequest request) {
        //对请求参数解析
       // String origin = request.getParameter("origin");
      //  return origin;
        //对请求ip解析
       // String ip = request.getRemoteAddr();
       // System.out.println("ip:"+ip);
       // return ip;
        //求请求头解析
        String token=request.getHeader("token");
        return token;
    }
}
